﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.d80_bchzMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>d80_bchz</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = d80_bchz_MainStore.getAt(index).get('id');
            
			Txtgrbm.setValue(d80_bchz_MainStore.getAt(index).get('grbm'));
			Txtdzbm.setValue(d80_bchz_MainStore.getAt(index).get('dzbm'));
			Txthbh.setValue(d80_bchz_MainStore.getAt(index).get('hbh'));
			Txtrbh.setValue(d80_bchz_MainStore.getAt(index).get('rbh'));
			Txtljmzfy.setValue(d80_bchz_MainStore.getAt(index).get('ljmzfy'));
			Txtljmzbc.setValue(d80_bchz_MainStore.getAt(index).get('ljmzbc'));
			Txtljzyfy.setValue(d80_bchz_MainStore.getAt(index).get('ljzyfy'));
			Txtljzykb.setValue(d80_bchz_MainStore.getAt(index).get('ljzykb'));
			Txtljzybc.setValue(d80_bchz_MainStore.getAt(index).get('ljzybc'));
			Txtljdbbc.setValue(d80_bchz_MainStore.getAt(index).get('ljdbbc'));
			Txtljmbfy.setValue(d80_bchz_MainStore.getAt(index).get('ljmbfy'));
			Txtljmbbc.setValue(d80_bchz_MainStore.getAt(index).get('ljmbbc'));
			Txtdqzt.setValue(d80_bchz_MainStore.getAt(index).get('dqzt'));
			Txtnn.setValue(d80_bchz_MainStore.getAt(index).get('nn'));
			Txtzjfy.setValue(d80_bchz_MainStore.getAt(index).get('zjfy'));
			Txtljdb.setValue(d80_bchz_MainStore.getAt(index).get('ljdb'));
			Txtljfmbc.setValue(d80_bchz_MainStore.getAt(index).get('ljfmbc'));
			Txtljtjbc.setValue(d80_bchz_MainStore.getAt(index).get('ljtjbc'));
			TxtNumrc.setValue(d80_bchz_MainStore.getAt(index).get('rc'));
			Txtallhz.setValue(d80_bchz_MainStore.getAt(index).get('allhz'));
			Txtljmbkb.setValue(d80_bchz_MainStore.getAt(index).get('ljmbkb'));

            d80_bchz_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--d80_bchz表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="d80_bchz_MainStore" OnRefreshData="d80_bchz_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="id">
                <Fields>
                    
					<ext:RecordField Name="id" />
					<ext:RecordField Name="grbm" />
					<ext:RecordField Name="dzbm" />
					<ext:RecordField Name="hbh" />
					<ext:RecordField Name="rbh" />
					<ext:RecordField Name="ljmzfy" />
					<ext:RecordField Name="ljmzbc" />
					<ext:RecordField Name="ljzyfy" />
					<ext:RecordField Name="ljzykb" />
					<ext:RecordField Name="ljzybc" />
					<ext:RecordField Name="ljdbbc" />
					<ext:RecordField Name="ljmbfy" />
					<ext:RecordField Name="ljmbbc" />
					<ext:RecordField Name="dqzt" />
					<ext:RecordField Name="nn" />
					<ext:RecordField Name="zjfy" />
					<ext:RecordField Name="ljdb" />
					<ext:RecordField Name="ljfmbc" />
					<ext:RecordField Name="ljtjbc" />
					<ext:RecordField Name="rc" />
					<ext:RecordField Name="allhz" />
					<ext:RecordField Name="ljmbkb" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--d80_bchz页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="d80_bchz_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="d80_bchz_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{d80_bchz_MainForm}.getForm().reset();#{Hid}.setValue('');#{d80_bchz_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{d80_bchz_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{d80_bchz_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(d80_bchz_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="d80_bchz_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="id" />
                                
								<ext:Column Header="grbm" Sortable="true" DataIndex="grbm" />
								<ext:Column Header="dzbm" Sortable="true" DataIndex="dzbm" />
								<ext:Column Header="hbh" Sortable="true" DataIndex="hbh" />
								<ext:Column Header="rbh" Sortable="true" DataIndex="rbh" />
								<ext:Column Header="ljmzfy" Sortable="true" DataIndex="ljmzfy" />
								<ext:Column Header="ljmzbc" Sortable="true" DataIndex="ljmzbc" />
								<ext:Column Header="ljzyfy" Sortable="true" DataIndex="ljzyfy" />
								<ext:Column Header="ljzykb" Sortable="true" DataIndex="ljzykb" />
								<ext:Column Header="ljzybc" Sortable="true" DataIndex="ljzybc" />
								<ext:Column Header="ljdbbc" Sortable="true" DataIndex="ljdbbc" />
								<ext:Column Header="ljmbfy" Sortable="true" DataIndex="ljmbfy" />
								<ext:Column Header="ljmbbc" Sortable="true" DataIndex="ljmbbc" />
								<ext:Column Header="dqzt" Sortable="true" DataIndex="dqzt" />
								<ext:Column Header="nn" Sortable="true" DataIndex="nn" />
								<ext:Column Header="zjfy" Sortable="true" DataIndex="zjfy" />
								<ext:Column Header="ljdb" Sortable="true" DataIndex="ljdb" />
								<ext:Column Header="ljfmbc" Sortable="true" DataIndex="ljfmbc" />
								<ext:Column Header="ljtjbc" Sortable="true" DataIndex="ljtjbc" />
								<ext:Column Header="rc" Sortable="true" DataIndex="rc" />
								<ext:Column Header="allhz" Sortable="true" DataIndex="allhz" />
								<ext:Column Header="ljmbkb" Sortable="true" DataIndex="ljmbkb" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="d80_bchz_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="grbm" />
								<ext:StringFilter DataIndex="dzbm" />
								<ext:StringFilter DataIndex="hbh" />
								<ext:StringFilter DataIndex="rbh" />
								<ext:StringFilter DataIndex="ljmzfy" />
								<ext:StringFilter DataIndex="ljmzbc" />
								<ext:StringFilter DataIndex="ljzyfy" />
								<ext:StringFilter DataIndex="ljzykb" />
								<ext:StringFilter DataIndex="ljzybc" />
								<ext:StringFilter DataIndex="ljdbbc" />
								<ext:StringFilter DataIndex="ljmbfy" />
								<ext:StringFilter DataIndex="ljmbbc" />
								<ext:StringFilter DataIndex="dqzt" />
								<ext:StringFilter DataIndex="nn" />
								<ext:StringFilter DataIndex="zjfy" />
								<ext:StringFilter DataIndex="ljdb" />
								<ext:StringFilter DataIndex="ljfmbc" />
								<ext:StringFilter DataIndex="ljtjbc" />
								<ext:StringFilter DataIndex="allhz" />
								<ext:StringFilter DataIndex="ljmbkb" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="d80_bchz_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--d80_bchz表修改，添加主窗体-->
    <ext:Window ID="d80_bchz_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="d80_bchz_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="330" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtgrbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="grbm" />
							<ext:TextField ID="Txthbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hbh" />
							<ext:TextField ID="Txtljmzfy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljmzfy" />
							<ext:TextField ID="Txtljzyfy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljzyfy" />
							<ext:TextField ID="Txtljzybc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljzybc" />
							<ext:TextField ID="Txtljmbfy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljmbfy" />
							<ext:TextField ID="Txtdqzt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dqzt" />
							<ext:TextField ID="Txtzjfy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="zjfy" />
							<ext:TextField ID="Txtljfmbc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljfmbc" />
							<ext:NumberField ID="TxtNumrc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rc" />
							<ext:TextField ID="Txtljmbkb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljmbkb" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtdzbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dzbm" />
							<ext:TextField ID="Txtrbh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="rbh" />
							<ext:TextField ID="Txtljmzbc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljmzbc" />
							<ext:TextField ID="Txtljzykb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljzykb" />
							<ext:TextField ID="Txtljdbbc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljdbbc" />
							<ext:TextField ID="Txtljmbbc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljmbbc" />
							<ext:TextField ID="Txtnn" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="nn" />
							<ext:TextField ID="Txtljdb" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljdb" />
							<ext:TextField ID="Txtljtjbc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ljtjbc" />
							<ext:TextField ID="Txtallhz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="allhz" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{d80_bchz_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{d80_bchz_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
